import { ref } from "vue";
import { helperUrl } from "./requestAddress";

//获取地址栏参数
export const GetParamUrl = function (name: string) {
  return (
    decodeURIComponent(
      (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
        location.href
      ) || [, ""])[1].replace(/\+/g, "%20")
    ) || ""
  );
};

//帮助文件方法
export const helperFileMethod = function (helperPath: string) {
  const helperRoute = ref<string>(helperUrl + helperPath);
  window.open(helperRoute.value, '_blank');
}